from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait


class AnonymousHomePage:
    def __init__(self, driver):
        self.driver = driver

    def find_language(self):
        xpath = '/html/body/div[2]/div/div[3]/div[3]/a/i'
        elem = WebDriverWait(self.driver, 10).until(
            EC.presence_of_element_located((By.XPATH, xpath)))
        return elem

    def find_chinese(self):
        xpath = '/html/body/div[2]/div/div[2]/div[3]/ul/li[2]'
        elem = WebDriverWait(self.driver, 10).until(
            EC.presence_of_element_located((By.XPATH, xpath)))
        return elem

    def find_login_btn(self):
        xpath = '/html/body/div[2]/div/div[3]/div[2]'
        elem = self.driver.find_element(By.XPATH, xpath)
        return elem
